#ifndef TABWIDGET_H
#define TABWIDGET_H

#include <QtCore/QVariant>
#include <QtCore/QPoint>
#include <QtGui/QTabWidget>
#include <QtGui/QTabBar>
#include <QtGui/QAction>
#include <QtGui/QMenu>
#include <QtGui/QMouseEvent>
//#include <Qsci/qsciscintilla.h>
#include <QtCore/QFileInfo>
#include <QtDebug>
#include <QVector>
#include <QMessageBox>
#include "Scintilla.h"
#include "Config.h"

class TabBar:public QTabBar
{
	Q_OBJECT
	public:
		TabBar(QWidget* parent = 0);
		virtual ~TabBar(void);
	protected slots:
		virtual void mousePressEvent ( QMouseEvent *e );
	signals:
		void Close(void);
		void CloseOther(void);
		void CloseAll(void);
	private:
		QMenu*	PopMenu;
		QAction* ActClose;
		QAction* ActCloseAll;
		QAction* ActCloseOther;
		QWidget* M_Page;

};

class TabWidget:public QTabWidget
{
	Q_OBJECT
	public:
		TabWidget(QWidget* parent = 0);
		virtual ~TabWidget(void);
		void addTabInfo(TabInfo* TInfo);
		void setTabInfo(int index,const QString& fn);
		void setTabInfo(const QString& fn);
		TabInfo* GetCurTabInfo(void);
	private:
		void m_setTabInfo(int index,const QString& fn);
		//QsciScintilla* GetScintilla(const QWidget* Widget);
		Scintilla* GetScintilla(const QWidget* Widget);
		QVector<TabInfo*> TabVec;
		TabBar* YTabBar;
	public  slots:
		void CloseAllTab(void);
	private slots:
		void CloseTab(void);
		void CloseOtherTab(void);
	signals:
		void TabSaveFile();
		void CreateNewFile();
};

#endif
